package per.turtle.system.feign.factory;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import per.turtle.system.feign.RemoteConfigService;
import per.turtle.system.feign.fallback.RemoteConfigFallbackImpl;

/**
 * 配置服务降级处理
 *
 * @author turtle
 */
@Component
public class RemoteConfigFallbackFactory implements FallbackFactory<RemoteConfigService> {

    @Override
    public RemoteConfigService create(Throwable throwable) {
        RemoteConfigFallbackImpl fallback = new RemoteConfigFallbackImpl();
        fallback.setCause(throwable);
        return fallback;
    }

}
